using System;
using System.Collections.Generic;
using System.IO.Pipes;
using System.Text;

namespace VisualGTest.Binding
{
    /// <summary>
    /// The state object for the IAsyncResult object that should be
    /// available to calls to the private RunTests method.
    /// </summary>
    class TestRunAsyncState
    {
        #region property backing variables
        private NamedPipeServerStream _pipeServer;
        private IProcess _gtest;
        private ITestEventListener _listener;
        private bool _connected;
        #endregion

        #region properties
        public NamedPipeServerStream PipeServer
        {
            get { return _pipeServer; }
            set { _pipeServer = value; }
        }

        public IProcess GTest
        {
            get { return _gtest; }
            set { _gtest = value; }
        }

        public ITestEventListener Listener
        {
            get { return _listener; }
            set { _listener = value; }
        }

        /// <summary>
        /// Whether the pipe connection was successful. This is not used to
        /// indicate whether the pipe is currently connected.
        /// </summary>
        public bool Connected
        {
            get { return _connected; }
            set { _connected = value; }
        }
        #endregion

        public TestRunAsyncState()
        {
            this.PipeServer = null;
            this.GTest = null;
            this.Listener = null;
        }

        public TestRunAsyncState(NamedPipeServerStream pipeServer, IProcess gtest, ITestEventListener listener)
        {
            this.PipeServer = pipeServer;
            this.GTest = gtest;
            this.Listener = listener;
        }
    }
}
